<%--
  Created by IntelliJ IDEA.
  User: LW
  Date: 2022/11/1
  Time: 22:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="service.impl.NserviceImpl" %>
<%@ page import="pojo.News" %>
<%@ page import="pojo.User" %>
<%@ page import="service.Nservice" %>
<html>
<head>
    <title>Title</title>
    <%
        Nservice service = new NserviceImpl();
        String uid=request.getParameter("id");
        int id= Integer.parseInt(uid);
        NserviceImpl nservice=new NserviceImpl();
        News news= nservice.selectById(id);
        int view_count=news.getView_count();
        service.addup(id,view_count);
        session.setAttribute("news",news);
    %>
    <script src="../asset/js/jquery-3.6.1.min.js"></script>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

</head>
<body>
<ul class="nav nav-pills">
    <li role="presentation"  style="padding-right: 30px"><a href="../index.jsp">主页</a></li>
    <li role="presentation"  style="padding-right: 40px"><a href="https://new.qq.com/ch/ent/">娱乐</a></li>
    <li role="presentation"  style="padding-right: 40px"><a href="https://new.qq.com/ch/sports/">体育</a></li>
    <li role="presentation"  style="padding-right: 40px"><a href="https://new.qq.com/ch/milite/">军事</a></li>
    <li role="presentation"  style="padding-right: 40px"><a href="https://new.qq.com/ch/tech/">科技</a></li>
    <li role="presentation"  style="padding-right: 40px"><a href="https://new.qq.com/ch/finance/">财经</a></li>
</ul>
<c:if test="${news!=null}">
<div class="row">
    <div class="col-xs-6 col-md-3">
        <a href="#" class="thumbnail">
            <img src="../asset/${news.cover_url}" alt="...">
        </a>
    </div>
    <div class="col-xs-6 col-md-3">
        <h3>&emsp; 作者：${news.author}</h3><h3>&emsp; 发布时间：${news.create_time}</h3><h3>&emsp; 浏览次数：${news.view_count}</h3>
    </div>
</div>
<div style="text-align: center">
    <h2 >&emsp; ${news.title}</h2><br>
    <h3 >&emsp;&emsp;${news.content} </h3>
</div>
</c:if>
</body>
</html>
